<ion-header-bar align-title="center"   class="bar bar-header bar-light" style='background: url(img/icon/headerline.png); background-size: contain; background-position: bottom; background-repeat: no-repeat;'>
  <a class="button icon-left ion-ios-arrow-left button-clear button-light" ng-click="backGo()"></a>

  <h1 class="title">{{title}}</h1>
</ion-header-bar>
<div class="tabs-striped tabs-top tabs-light tabs-icon-top" ng-show="edit">
  <div class="tabs" style="background-color:#F6F6F6;">
    <a ng-class="{detail: 'tab-item active', comment: 'tab-item'}[isActive]" data-active="detail"
       ng-click="changeTab($event)" style="font-size:16px;line-height:48px;">详情</a>
    <a ng-class="{detail: 'tab-item', comment: 'tab-item active'}[isActive]" data-active="comment"
       ng-click="changeTab($event)" style="font-size:16px;line-height:48px;">审批记录</a>
  </div>
</div>
<ion-content class="content bg ">
  <ion-refresher pulling-text="<span class='pulling-text-auto'>{{pulltextchange}}</span>" on-refresh="doRefresh()"
                 on-pulling="pulltext()" spinner="ripple" pulling-icon="ion-ios-refresh-empty"></ion-refresher>
  <ul class="list" ng-show="!edit&&!selectAssignee">
    <li class="item item-icon-right" ng-repeat="waitdo in waitdos" ng-click="show(waitdo)"
        style="border: none; margin-top: 1.5%;">
      <a class="button icon-right ion-ios-arrow-right button-clear button-light" style="position:absolute; top: 25%; right: 2%;"></a>
      <img style="float: left; width: 15px; height: 15px; position: relative; left: -3px;top: 2px;"
           src="img/icon/icon_assetName.png"/>

      <h2>{{waitdo.processDefinitionName}}</h2>
      <hr style="margin-left: -20px;border-top-style: initial;"/>
      <p ng-show ="waitdo.form.title">标题：<span>{{waitdo.form.title}}</span></p>
      <p>发起人：<span ed-options="user">{{waitdo.starter}}</span></p>

      <p>发起时间：{{waitdo.createTime}}</p>
    </li>
  </ul>
  <div ng-show="edit" style="padding-top: 44px;">
    <ion-list ng-if="isActive == 'detail'">
      <div class="detailContent" style="padding-top: 3%;padding-bottom: 3%;">
        <div style="border: 0px solid #fff;padding-top: 1%;" ng-repeat="field in fields " ng-show="field.showType!=0">
          <div style="display: inline-block;width: 100px">{{field.title}}:</div>
          <span style="color: #666;overflow: hidden;" ng-if="field.options" ed-options="{{field.options}}">{{field.value}}</span>
          <span style="color: #666;overflow: hidden;" ng-if="(!field.options)&&field.col!='files'">{{field.value}}</span>
          <div ng-repeat = "file in fields.files" ng-if="field.col=='files'">
            <span><a href="#" ng-click="mClick(file.url)">{{file.name}}</a></span>
          </div>

        </div>
        <div style="border:0px solid #fff;height: 100px;padding-top: 1%;padding-bottom: 1%;" ng-repeat="property in task.properties.properties"
             ng-show="property.readable && property.writable && property.id.indexOf('comment_') == 0 && property.id.indexOf('Vote') == -1 ">
          <div style="display: inline-block;width: 100px;">{{property.name}}</div>
                <textarea style="display: inline-block;background-color: #f6f6f6;width: 60%;height: 100%;"
                          ng-model="task.form[property.id]"></textarea>
              <input type = "checkbox" ng-model ="task.form.send_huiBanDuiShiAuditVote" ng-show="task.form.showVote" > <span ng-show="task.form.showVote" >驳回</span>
        </div>
      </div>
    </ion-list>
    <ion-list ng-if="isActive == 'comment'">

      <div ng-repeat="comment in comments ">
        <div ng-if="comment ==comments[0]">
          <div class="card" style=" margin-left: 25%;padding-left: 2%;padding-top: 2%;margin-bottom: 0;">
          <p>审批人：<span ed-options="user">{{comment.approver}}</span></p>
          <p>审批节点：{{comment.taskName}}</p>
          <p style="color: green">审批意见：{{comment.message}}</p>
          <p>审批时间：{{comment.addTime}}</p>
          </div>
          <div class="ion-ionic" style="color:green;font-size: 30px;position: relative;bottom: 82px;left: 9%;display: block;">
          <table class="jcline" style="height:135px;border:1px dashed #ddd;border-left-style:dashed;border-width:1px;float: left;position: relative;top: 25px;"><tr><td valign="top"></td></tr></table></div>
        </div>
        <div  ng-if="comment !=comments[0]">
          <div class="card" style=" margin-left: 25%;padding-left: 2%;padding-top: 2%;margin-top: 0;margin-bottom: 0;">
          <p>审批人：<span ed-options="user">{{comment.approver}}</span></p>
          <p>审批节点：{{comment.taskName}}</p>
          <p style="color: green">审批意见：{{comment.message}}</p>
          <p>审批时间：{{comment.addTime}}</p>
          </div>
          <div class="ion-arrow-up-c" style="color:green;font-size: 30px;position: relative;bottom: 82px;left: 10%;">
            <table class="jcline_2" style="height:135px;border:1px dashed #ddd;border-left-style:dashed;border-width:1px;float: left;position: relative;top: 25px;"><tr><td valign="top"></td></tr></table></div>
        </div>

      </div>

    </ion-list>
  </div>
  <div ng-show="selectAssignee">
    <ion-list>
      <ion-item>
        办理人:
        <div user-select ed-multiple="false" ng-if="!selectMultiple" ng-model="assignee.falseAssignee"></div>
        <div user-select ed-multiple="true" ng-if="selectMultiple" ng-model="assignee.trueAssignee"></div>
        <hr class="hr"><br>
        抄送:
        <div user-select ed-multiple="true" ng-model="cc.trueCc"></div>
      </ion-item>
      <ion-item style="border: 0px; text-align: center">
        <button style="width: 70px;height: 20px;line-height: 19px;" class="button button-small button-light" ng-click="approval(currentButton)"
          >提交
        </button>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button style="width: 70px;height: 20px;line-height: 19px;" class="button button-small button-light" ng-click="backGo()"
          >取消
        </button>
      </ion-item>
    </ion-list>
  </div>


  <div ed-ion-infinite-scroll></div>


</ion-content>


<ionic-footer class="bar bar-footer" ng-show="edit">
  <div ng-class="{5: 'col-20',4: 'col-25',3: 'col-33', 2: 'col-50',1:'col-100'}[buttons.length]"
       ng-repeat="button in buttons" style="text-align: center;"
       ng-click="approval(button)">
    <button class="button button-light"
      >{{button.name}}
    </button>
  </div>
</ionic-footer>

